<template>
  <div class="platform-news-container">
    <div class="header">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>平台动态</el-breadcrumb-item>
      </el-breadcrumb>
      <h2>平台动态</h2>
    </div>

    <div class="news-list">
      <el-table :data="newsList" style="width: 100%" @row-click="handleRowClick">
        <el-table-column width="50">
          <template #default>
            <el-icon><img src="/public/images/pic3.png"></el-icon>
          </template>
        </el-table-column>
        <el-table-column prop="title" label="动态标题"></el-table-column>
        <el-table-column prop="date" label="发布时间" width="180"></el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { Document } from '@element-plus/icons-vue'

export default {
  name: 'PlatformNewsList',
  components: {
    Document
  },
  data() {
    return {
      newsList: [
        { id: 1, title: '四川省交通建设集团有限责任公司智能化科场招标采购的公示', date: '2022-04-13' },
        { id: 2, title: '校工会交百智能平板采购竞价成交公告', date: '2022-04-13' },
        { id: 3, title: '平邑县图书馆馆藏图书及智能化设备采购项目中标结果公示', date: '2022-04-13' },
        { id: 4, title: '三一智能电机-局部放电设备-招标招标公告-ZB202304130003', date: '2022-04-13' },
        { id: 5, title: '中电鸿信信息科技有限公司2023年警务室智能化改造项目单一来源采购方案公示', date: '2022-04-13' },
        { id: 6, title: '海头镇宅基村土地发包项目', date: '2022-04-13' },
        { id: 7, title: '先锋创业大楼（515-1室）60㎡', date: '2022-04-13' },
        { id: 8, title: '万达开绿色智能铸造产业园项目（二期）比选结果公告', date: '2022-04-13' },
        { id: 9, title: '2023年度工伤基金结算支付智能审核监控项目竞争性磋商公告', date: '2022-04-13' },
        { id: 10, title: '万达开绿色智能铸造产业园项目（三期）比选结果公告', date: '2022-04-13' }
      ]
    }
  },
  methods: {
    handleRowClick(row) {
      this.$router.push({ name: 'NewsDetail', params: { id: row.id } })
    }
  }
}
</script>

<style scoped>
.platform-news-container {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.header h2 {
  margin-top: 10px;
  font-size: 24px;
  color: #333;
}

.news-list {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.el-table {
  cursor: pointer;
}

.el-table :deep(.el-table__row:hover) {
  background-color: #f5f7fa;
}

.el-icon {
  color: #409EFF;
  font-size: 18px;
}
</style>